<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="css/resigest.css">
</head>
<body>
    <div class="header"></div>

    <div class="Box">
        <div class="Box_content">
            <div class="fromtable">
                <h3 class="registerbtn2">注册帐号</h3>
                <div class="zoneInput regions">
                    <div class="zoneInput_country">国家/地区</div>
                    <input type="text" value="中国">
                </div>
                <p class="region_tip">成功注册帐号后，国家/地区将不可更改</p>
                <div class="zoneInput account">
                    <input type="text" placeholder="请输入手机号码或邮箱">
                </div>
                <div class="input realme passwordIcon input_icon">
                    <input type="password" placeholder="请输入密码" value="">
                </div>
                <p class="region_tip">密码由 6-16 位数字、字母或符号组成、至少包含两种字符</p>
                <div class="agree_text">
                    <i class="agree_btn "></i>
                    <div class="agree_check">
                        已阅读并同意<span>《帐号使用协议》</span><span>《隐私政策》</span>
                    </div>
                </div>
                <input type="button" class="button realme disabled primary_btn" value="注册"></input>
            </div>
        </div>
    </div>

    <div class="footer">
        <p class="service_text">欢太为 realme 用户提供帐号服务</p>
        <p><span>© 2005 - 2020 广东欢太 版权所有 粤ICP备 14056724 号-2</span></p>
    </div>


    <script src="jquery.min.js"></script>
    <script>
        $(".agree_btn").click(function(){
            $(".agree_btn").toggleClass("checked")
        })
    </script>
    <script>
       
        $(".primary_btn").click(function(){
            let username = $(".account input").val();
            let password = $(".passwordIcon input").val()
            $.ajax({
                url:"http://127.0.0.1:82/resigest",
                data:{
                    username:username,
                    password:password
                },
                success(data){
                    if(data === "success"){
                        alert("注册成功！")
                        open("http://127.0.0.1:82/login.html")
                    }
                    else{
                        alert("注册失败！")
                    }
                }
            })
        })
    </script>
</body>
</html>